<template>
<div>
  <Title title="猜你喜欢"></Title>
  
  <div class="like">
    
    <div class="goods" v-for="(item, index) in likeData.data" :key="index" @click="goDetail(item.id)">
      <div class="photo">
        <img v-lazy="item.imgUrl" alt="" loading='./images/dhp.jpg' />
      </div>
      <div class="name">
        {{ item.name }}
      </div>
      <div class="price">
        <span>¥</span>
        <span>{{ item.price }}</span>
      </div>
    </div>
  </div>
</div>
  
</template>

<script>
import Title from "@/components/common/title";
export default {
  props:['likeData'],
  components: {  
    Title,
  },
  data() {
    return {
 
    };
  },
  methods:{
    goDetail(id){
      this.$router.push({path:'/detail',query:{id}})
     
    }
  },
  mounted(){
   
  }
};
</script>

<style scoped lang='scss'>
.like{
    padding: 0.2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}
img {
  width: 100%;
  height: 100%;
}
.photo {
  width: 4.7317rem;
  height: 4.7317rem;
  background-color: #f3f3f3;
}
.name {
  font-size: 0.4rem;
  padding: 0.1951rem 0;
}
.price {
  font-size: 0.5rem;
  color: #b0352f;
  margin-bottom: 0.4rem;
}
</style>